package com.example.hello;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

public class RateDetailActivity extends AppCompatActivity {
    public  static  final  String TAG="rate2";
    float cval;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_rate_detail);
        //接受
        Intent intent = getIntent();
        String cname=intent.getStringExtra("cname");
        cval=intent.getFloatExtra("cval",0.0f);

        Log.i(TAG,"detail:cname="+cname);
        Log.i(TAG,"detail:cval="+100f/cval);

        TextView bizhong=findViewById(R.id.cname);
        bizhong.setText(cname);

    }
    public void myclick(View v) {
        EditText rmb=findViewById(R.id.inp);
        String str = rmb.getText().toString();
        Float s=Float.parseFloat(str);
        cval=100f/cval;
        s=s*cval;

        TextView res=findViewById(R.id.res);
        res.setText("result："+s);
    }
}